﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
//using System.Xml.Linq;
using System.Collections.Generic;

using YouHP.BLL;
using YouHP.Model;
using YouHP.Utility;

namespace web.admin
{
    public partial class BulletinList : System.Web.UI.Page
    {
        NewsInfoBLL newsInfoBLL = NewsInfoBLL.Instance;

        protected void Page_Load(object sender, EventArgs e)
        {
            DeleteNewsByID();
            bind();
        }
        protected void search_Click(object sender, EventArgs e)
        {

        }

        private void bind()
        {
            List<NewsInfo> list = null;

            try
            {
                list = newsInfoBLL.GetBulletinInfoList();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            this.newsList.DataSource = list;
            this.newsList.DataBind();
        }

        private void DeleteNewsByID()
        {
            int id = RequestTools.GetQueryInt("id", -1);
            if (id != -1)
            {
                newsInfoBLL.DeleteNewsInfo(id);
            }
        }


    }
}
